<?php
declare (strict_types = 1);

namespace app\index\model;

use app\common\model\message\Like as LikeModel;

/**
 * @mixin think\Model
 */
class Like extends LikeModel
{
    public static function likedModel(int $article_id){
        $user = app()->user;
        if($user->isGuest()) return false;

        return static::where([
            'user_id' => $user->getId(),
            'article_id' => $article_id
        ])->findOrEmpty();
    }
}
